# "-v","-s",日志详细信息
# --clean-alluredir 清空数据 获得最新的数据
# --alluredir=allre-results 生成测试数据 保存在allure-results文件夹 名称可随便改
import os

import pytest
from allure_combine import combine_allure
# 获取用例文件夹template 的相对路径
test_dir = os.path.join(os.path.dirname(__file__),"..","core\ApiTestRunner.py")

pytest_args = ["-v","-s",
               "--clean-alluredir",
               "--alluredir=allure-results",
               f"{test_dir}"
                ]
#
pytest.main(pytest_args)
os.system("allure generate allure-results -o allure-report --sort-by=name --sort-direction=asc --clean")
combine_allure("./allure-report")

